Add presence validation

Daniel O'Connor 11 年之前
父节点
当前提交
2ec6c618d8
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      app/models/agents/mqtt_agent.rb

+ 4 - 4
app/models/agents/mqtt_agent.rb

@@ -67,10 +67,10 @@ module Agents
67 67
     MD
68 68
 
69 69
     def validate_options
70
-      # unless options['uid'].present? &&
71
-      #   options['expected_update_period_in_days'].present?
72
-      #   errors.add(:base, "expected_update_period_in_days and uid are required")
73
-      # end
70
+      unless options['uri'].present? &&
71
+        options['topic'].present?
72
+        errors.add(:base, "topic and uri are required")
73
+      end
74 74
     end
75 75
 
76 76
     def working?